package com.example.wordserver.controller;


import com.example.wordserver.Service.CityService;
import com.example.wordserver.entity.City;
import com.example.wordserver.service.impl.CityServiceImpl;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

//import javax.annotation.Resource;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lhx
 * @since 2024-01-27
 */
@RestController
@RequestMapping("/city")
@CrossOrigin
public class CityController {
 @Resource
 private CityServiceImpl cityService=new CityServiceImpl();
 @GetMapping("/getById/{id}")
    public City getCityByid(@PathVariable Integer id)
 {
      return  cityService.getById(id);
 }

}

